Using R for Trade Policy Analysis by Massimiliano Porto

Using R for Trade Policy Analysis by Massimiliano Porto

Author:Massimiliano Porto
Language: eng
Format: epub
ISBN: 9783030345297
Publisher: Springer International Publishing


tar11 <- summaryBy(tar_savg_ahs ~ sector, TPP_jpn,

na.rm = T, FUN=c(mean, median, sd, min, max))

tar22 <- summaryBy(tar_iwahs ~ sector, TPP_jpn,

na.rm = T, FUN=c(mean, median, sd, min, max))

tar33 <- summaryBy(tar_savg_mfn ~ sector, TPP_jpn,

na.rm = T, FUN=c(mean, median, sd, min, max))

tar44 <- summaryBy(tar_iwmfn ~ sector, TPP_jpn,

na.rm = T, FUN=c(mean, median, sd, min, max))

tar_jpn <- cbind(tar11, tar22, tar33, tar44)

View(tar_jpn)

tar_jpn <- tar_jpn[, -c(7, 13, 19)]

Note that the function summaryBy( ) can be applied to more than one variable. For example, we could have written

summaryBy(tar_savg_ahs + tar_iwahs + tar_savg_mfn + tar_iwmfn ~ sector,

TPP_jpn, na.rm = T, FUN=c(mean, median, sd, min, max))



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.